home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / System / Swatch / Development / swatch 1.7 / heap_list.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-09  |  2.2 KB  |  112 lines  |  [TEXT/KAHL]

  1. /**
  2.  
  3.     heap_list.h
  4.     Copyright (c) 1990-1992, joe holt
  5.  
  6.  **/
  7.  
  8.  
  9. #ifndef __heap_list__
  10. #define __heap_list__
  11.  
  12. /*******************************************************************************
  13.  **
  14.  **    Headers
  15.  **
  16.  **/
  17.  
  18. #include <Processes.h>
  19.  
  20. #ifndef __ctypes__
  21. #include "ctypes.h"
  22. #endif
  23. #ifndef __display__
  24. #include "display.h"
  25. #endif
  26. #ifndef __linked_list__
  27. #include "linked_list.h"
  28. #endif
  29.  
  30.  
  31. /*******************************************************************************
  32.  **
  33.  **    Public Constants
  34.  **
  35.  **/
  36.  
  37. enum {
  38.     MAX_HEAP_TRANSITIONS = 5000
  39. };
  40.  
  41. enum {
  42.     BLOCK_TYPE_NOT_FREE_MASK = 0xC0,
  43.     BLOCK_TYPE_NONRELOCATABLE_MASK = 0x40,
  44.     BLOCK_TYPE_RELOCATABLE_MASK = 0x80,
  45.  
  46.     BLOCK_FLAG_RESOURCE_MASK = 0x20,
  47.     BLOCK_FLAG_PURGE_MASK = 0x40,
  48.     BLOCK_FLAG_LOCK_MASK = 0x80
  49. };
  50.  
  51. /*******************************************************************************
  52.  **
  53.  **    Public Variables
  54.  **
  55.  **/
  56.  
  57. typedef struct {
  58.     Ptr logical_start, logical_end;
  59.     Ptr physical_start, physical_end;
  60.     unsigned char type, flags;
  61.     Handle handle;
  62. } Heap_block_info_t;
  63.  
  64.  
  65. typedef struct _t_Heap_info {
  66.     THz zone;
  67.     ProcessInfoRec info;
  68.     struct _t_ExtendedProcessInfoRec **xinfo;
  69.     unsigned char appname[32];
  70.  
  71.     Boolean touched:1;
  72.     Boolean updating:1, last_updating:1;
  73.     Boolean has_selection:1, last_has_selection:1;
  74.     Boolean heap_is_32_bit:1;
  75.     Boolean current_heap_ok:1, last_heap_ok:1;
  76.     int16 selection_phase;
  77.     row_t row;
  78.  
  79.     int32 current_size, last_size;
  80.     int32 current_free, last_free;
  81.     int16 current_islands, last_islands;
  82.     int16 current_heap_transitions, last_heap_transitions;
  83.     Heap_block_info_t current_selection, last_selection;
  84.     int32 current_heap_offset_pixels, last_heap_offset_pixels;
  85.     int32 current_heap[MAX_HEAP_TRANSITIONS], last_heap[MAX_HEAP_TRANSITIONS];
  86.     int16 last_heap_x;
  87. } Heap_info_t;
  88.  
  89. typedef l_elem_t Heap_info_handle_t;
  90.  
  91.  
  92. extern Boolean Memory_Manager_is_32_bit;
  93. extern l_anchor_t heaps;
  94. extern Heap_info_handle_t multifinder, system;
  95.  
  96.  
  97. /*******************************************************************************
  98.  **
  99.  **    Public Functions
  100.  **
  101.  **/
  102.  
  103. void Heap_list_init( void );
  104. void Heap_list_exit( void );
  105. int16 Heap_list_count(void);
  106. int32 Heap_list_largest_heap_size( void );
  107. Boolean Heap_list_update( void );
  108. void Heap_list_update_one( Heap_info_handle_t h );
  109. Boolean Heap_list_resort( void );
  110.  
  111. #endif
  112.